import { getHotRecommends } from "@/api/recommend";
import { CHANGE_HOT_RECOMMENDS } from "./constants";

export const changeHotRecommendAction = payload => ({
  type: CHANGE_HOT_RECOMMENDS,
  payload,
});

export const getHotRecommendsAction = () => {
  return dispatch => {
    getHotRecommends().then(res => {
      dispatch(changeHotRecommendAction(res.result));
    });
  };
};
